import http from 'utils/http';

/**
 * 获取创建任务相关人员，标注员1，初审员2，复审员3
 * @param data {type}
 * @returns
 */
export const getRelationUserForTask = (data: any) => http({
    url: '/api/batchTask/getRelationUsersForTask',
    method: 'post',
    data,
});

/**
 *
 * 创建任务
 * @param data {
 * perTaskPicAmount: number;单个任务数
 * batchTaskName:string；任务名称
 * labelTemplateId：number;标注模版id
 * picStr:string;多个图片id用,号隔开
 * taskCheckPerson: {
 * labelUserId:number; 标注员id
 * firstCheckUserId:number;初审员id；
 * recheckUserId:number; 复审员id
 * }
 * }
 * @returns
 */
export const createNewTask = (data: any) => http({
    url: '/api/batchTask/createTask',
    method: 'post',
    data,
});

/**
 * 获取任务列表
 * @param data
 * @returns
 */
export const fetchTaskList = (data: any) => http({
    url: '/api/batchTask/listAllByFilter',
    method: 'post',
    data,
});

/**
 * 获取任务批次状态枚举
 * @param data
 * @returns
 */
export const fetchTaskStatusTypes = (data) => http({
    url: '/api/batchTask/getBatchTaskStatus',
    method: 'post',
    data,
});

/**
 * 获取任务创建人list
 * @param data
 * @returns
 */
export const fetchCreateUserList = (data) => http({
    url: '/api/batchTask/getAllCreateUser',
    method: 'post',
    data,
});

/**
 * 获取任务列表相关人员list，
 * @param data {type:number} type：1标注员，2初审员，3复审员
 * @returns
 */
export const fetchRelationUsersByFiler = (data) => http({
    url: '/api/batchTask/getRelationUsersByFilter',
    method: 'post',
    data
})

// 获取子任务图片状态枚举
export const fetchSubTaskStatusTypes = (data) => http({
    url: '/api/batchTask/getSubTaskStatus',
    method: 'post',
    data
})

/**
 * 获取子任务列表
 * @param data
 * @returns
 */
export const fetchSubTaskList = (data) => http({
    url: '/api/batchTask/subTaskListAll',
    method: 'post',
    data
})

export const closeBatchTask = (data) => http({
    url: '/api/batchTask/closeBatchTask',
    method: 'post',
    data
})